package com.chenyaowei.marketing.service.impl;

import com.chenyaowei.marketing.domain.CywCouponSpuCategoryRelation;
import com.chenyaowei.marketing.domain.CywCouponSpuRelation;
import com.chenyaowei.marketing.mapper.CywCouponSpuRelationMapper;
import com.chenyaowei.marketing.service.ICywCouponSpuRelationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 优惠券与产品关联Service业务层处理
 *
 * @author 陈耀威
 * @date 2023-11-28
 */
@Service
public class CywCouponSpuRelationServiceImpl implements ICywCouponSpuRelationService
{
    @Autowired
    private CywCouponSpuRelationMapper cywCouponSpuRelationMapper;

    /**
     * 查询优惠券与产品关联
     *
     * @param id 优惠券与产品关联主键
     * @return 优惠券与产品关联
     */
    @Override
    public CywCouponSpuRelation selectCywCouponSpuRelationById(Long id)
    {
        return cywCouponSpuRelationMapper.selectCywCouponSpuRelationById(id);
    }

    /**
     * 查询优惠券与产品关联列表
     *
     * @param cywCouponSpuRelation 优惠券与产品关联
     * @return 优惠券与产品关联
     */
    @Override
    public List<CywCouponSpuRelation> selectCywCouponSpuRelationList(CywCouponSpuRelation cywCouponSpuRelation)
    {
        return cywCouponSpuRelationMapper.selectCywCouponSpuRelationList(cywCouponSpuRelation);
    }

    /**
     * 新增优惠券与产品关联
     *
     * @param cywCouponSpuRelation 优惠券与产品关联
     * @return 结果
     */
    @Override
    public int insertCywCouponSpuRelation(CywCouponSpuRelation cywCouponSpuRelation)
    {
        return cywCouponSpuRelationMapper.insertCywCouponSpuRelation(cywCouponSpuRelation);
    }

    /**
     * 修改优惠券与产品关联
     *
     * @param cywCouponSpuRelation 优惠券与产品关联
     * @return 结果
     */
    @Override
    public int updateCywCouponSpuRelation(CywCouponSpuRelation cywCouponSpuRelation)
    {
        return cywCouponSpuRelationMapper.updateCywCouponSpuRelation(cywCouponSpuRelation);
    }

    /**
     * 批量删除优惠券与产品关联
     *
     * @param ids 需要删除的优惠券与产品关联主键
     * @return 结果
     */
    @Override
    public int deleteCywCouponSpuRelationByIds(Long[] ids)
    {
        return cywCouponSpuRelationMapper.deleteCywCouponSpuRelationByIds(ids);
    }

    /**
     * 删除优惠券与产品关联信息
     *
     * @param id 优惠券与产品关联主键
     * @return 结果
     */
    @Override
    public int deleteCywCouponSpuRelationById(Long id)
    {
        return cywCouponSpuRelationMapper.deleteCywCouponSpuRelationById(id);
    }

    @Override
    public List<CywCouponSpuRelation> selectListByCouponIds(List<Long> couponIds) {
        return cywCouponSpuRelationMapper.selectListByCouponIds(couponIds);
    }

    @Override
    public List<CywCouponSpuRelation> selectListByCouponId(Long couponId) {
        return cywCouponSpuRelationMapper.selectListByCouponId(couponId);
    }
}
